<?php include 'application/views/header.php' ?>
<?php // echo '<pre>'; print_r($Product); die; ?>
<script type="text/javascript" src="<?php echo base_url() ?>public/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>public/ckfinder/ckfinder.js"></script>
<h4 class="page-title">Khách hàng</h4>
<form accept="<?php echo base_url() ?>customer/edit/<?php echo $Customer['CustomerId'] ?>" method="post" id="frmPageEdit"
    enctype="multipart/form-data">
    <table width="100%" class="form customer-edit">
       <tr>
            <th>Mã số khách hàng</th>
            <td><?php echo $Customer['CustomerId'] ?></td>
       </tr>
       <tr>
            <th>Tên khách hàng</th>
            <td><input type="text" value="<?php echo $Customer['CustomerName'] ?>" name="CustomerName" id="CustomerName"/></td>
       </tr>
       <tr>
            <th>Địa chỉ khách hàng</th>
            <td><input type="text" value="<?php echo $Customer['CustomerAddress'] ?>" name="CustomerAddress" id="CustomerAddress"/></td>
       </tr>
       <tr>
            <th>Điện thoại khách hàng</th>
            <td><input type="text" value="<?php echo $Customer['CustomerPhone'] ?>" name="CustomerPhone" id="CustomerPhone"/></td>
       </tr>
       <tr>
            <th>Mô tả ngắn</th>
            <td>
                <textarea id="CustomerDescription" name="CustomerDescription"><?php echo $Customer['CustomerDescription'] ?></textarea>
            </td>
       </tr>
        <tr>
            <th>Mô tả nội dung khách hàng</th>
            <td>
                <textarea id="CustomerDetail" name="CustomerDetail"><?php echo $Customer['CustomerDetail'] ?></textarea>
            </td>
       </tr>
       <tr>
            <th>Video của khách hàng</th>
            <td>
                <?php echo form_dropdown('CustomerVideoId', $OptionsVideos, isset($Customer['CustomerVideoId']) ? $Customer['CustomerVideoId'] : ''); ?>
            </td>
       </tr>
       <tr>
            <th>Thuộc nhóm</th>
            <td>
                <?php echo form_dropdown('CategoryId', $OptionCategories, isset($Customer['CategoryId']) ? $Customer['CategoryId'] : '') ?>
            </td>
       </tr>
       <tr>
            <th>Hình ảnh khách hàng</th>
            <td>
                <?php if(isset($Customer['Image'])): ?>
                    <img src="<?php echo $this->config->item('base_download') ?>/customers/<?php echo $Customer['Image'] ?>" /><br />
                <?php endif; ?>
                <input type="file" name="Image" id="Image" />
            </td>
       </tr>
        <tr>
            <th>Ẩn hiện khách hàng</th>
            <td><input <?php echo ($Customer['Visible'] == 1 ? 'checked="checked"' : '') ?>" type="checkbox" value="1" name="Visible" id="Visible"  /></td>
       </tr>
    </table>
    <div class="clr button-set">
        <input type="submit" value="Lưu nội dung" id="btnSave" />
    </div>
</form>
<?php include 'application/views/footer.php' ?>
<script>
$('#btnBack').click(function(){
    window.location.href = '<?php echo base_url() ?>customer.html'; 
});
var ck = CKEDITOR.replace( 'CustomerDetail', { toolbar : 'Full'});
CKFinder.setupCKEditor( ck, { 
    basePath : '/admin/public/ckfinder/' 
} ) ;
</script>